<!--检索模态框开始-->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
     aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
          &times;
        </button>
        <h4 class="modal-title" id="myModalLabel">
          检索
        </h4>
      </div>
      <style>
        .modal-body tr,td{
          border: 1px solid #ccc;
        }
        .modal-body tr td{
          padding:5px;
        }
      </style>
      <div class="modal-body">
        <table id="tabb" style="border: 1px solid #ccc;">
        </table>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">关闭
        </button>
        <button type="button" class="btn btn-primary" data-dismiss="modal" onclick="abstrtions()">
          确定
        </button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal -->
</div>
<!--模态框结束-->
<script src="/assets/libs/jquery/dist/jquery.js"></script>
<script>
  $(document).ready(function() {
    $.ajax({
      type:"post",
      dataType:'json',
      url:"/api/index/special",
      success:function(res){
        console.log('res',res)
        if (res.code == 1) {
          var html='<tr style="border: 1px solid #ccc;">\n' +
                  '            <td><input type="checkbox" id="checkall" class="" value=""></td>\n' +
                  '            <td>特别约定</td>\n' +
                  '          </tr>'
          // for(var i=0;i<res.data.data.length;i++){
          //   html+=` <tr>
          //   <td><input type="checkbox" class="checkberif" value="`+res.data.data[i].sort+`、`+res.data.data[i].content+`"></td>
          //   <td>`+res.data.data[i].sort+`、`+res.data.data[i].content+`</td>
          // </tr>`
          // }
          for(var i=0;i<res.data.data.length;i++){
            html+=` <tr>
            <td><input type="checkbox" class="checkberif" value="`+res.data.data[i].content+`"></td>
            <td>`+res.data.data[i].content+`</td>
          </tr>`
          }
          for(var i=0;i<res.data.xc.length;i++){
            html+=` <tr>
            <td><input type="checkbox" checked class="checkberif" onclick="return false;"  value="`+res.data.xc[i]+`"></td>
            <td>`+res.data.xc[i]+`(<span style="color: red">*</span>此项为必须)</td>
          </tr>`
          }
          $("#tabb").html(html)
        } else {
          layer.msg(res.msg);
        }
      }
    });
  });
</script>